
import React from 'react';

import {start, connect} from '../../../../hrpub/common/store/index';

import HomePage from '../container';

import { handleHash,snCreateUIDom, getAppPageConfig } from 'src/hrpub/common/utils/utils'

import model from '../models/model';

const HomePageWithData = handleHash('201981516135101', 'c=60092040&p=60092040nccloud')(connect(HomePage));

const config = getAppPageConfig()
// const config = {
//     appcode:'60092040',
//     pagecode:'60092040nccloud'
// }

const appconfigTool = (config) => {
  
    const reqData = [{
        rqUrl: '/platform/templet/querypage.do',
        rqJson: `{\n  \"pagecode\": \"${config.pagecode}\",\n  \"appcode\": \"${config.appcode}\"\n}`,
        rqCode: 'template'
    }, {
        rqUrl: '/platform/templet/querypage.do',
        rqJson: `{\n  \"pagecode\": \"${config.appcode}batchAdd\",\n  \"appcode\": \"${config.appcode}\"\n}`,
        rqCode: 'batch_add'
    }, {
        rqUrl: '/platform/appregister/queryallbtns.do',
        rqJson: `{\n  \"pagecode\": \"${config.pagecode}\",\n  \"appcode\": \"${config.appcode}\"\n}`,
        rqCode: 'button'
    }, {
        rqUrl: '/platform/templet/querypage.do',
        rqJson: `{\n  \"pagecode\": \"60092010cb\",\n  \"appcode\": \"60092010\"\n}`,
        rqCode: 'org_situation'
    }, {
        rqUrl: '/platform/appregister/queryappcontext.do',
        rqJson: `{\n  \"appcode\": \"${config.appcode}\"}`,
        rqCode: 'context'
    }];
    return reqData
    
}
snCreateUIDom(config,appconfigTool(config)
,(res)=>{
        start({
            root: document.getElementById('app'),
            component: <HomePageWithData templateRes={res} />,
            model: model
        });
    }
)


